'''
Company: TWL
Author: xue jian
Email: xuejian@kanzhun.com
Date: 2020-12-01 10:38:30
'''
#
# @lc app=leetcode.cn id=34 lang=python3
#
# [34] 在排序数组中查找元素的第一个和最后一个位置
#

# @lc code=start
from typing import List
class Solution:
    def searchRange(self, nums: List[int], target: int) -> List[int]:
        import bisect
        l=bisect.bisect_left(nums, target)
        r=bisect.bisect_right(nums, target)
        return [l, r-1] if l!=r else [-1, -1]
# @lc code=end

